package com.atguigu.mybatis.lamda;

import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * Created by Smexy on 2022/11/29
 */
public class StreamLamdaDemo
{
    public static void main(String[] args) {

        //进行转换  stream2中的每个元素 + 10 ，取所有的奇数
        List<Integer> result = Stream
            .of(1, 2, 3, 4, 5)
            .map(in -> in + 10)
            .filter(in -> in % 2 == 1)
            .collect(Collectors.toList());

        System.out.println(result);

    }
}
